package com.iflytek.universitymanagement.controller;


import com.iflytek.universitymanagement.domain.CounselingRecord;
import com.iflytek.universitymanagement.service.CounselingRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/counselingRecord")
public class CounselingRecordController {
    @Autowired
    private CounselingRecordService counselingRecordService;

    @PostMapping("/add")
    public boolean addCounselingRecord(@RequestBody CounselingRecord record) {
        return counselingRecordService.save(record);
    }

    @GetMapping("/all")
    public List<CounselingRecord> getAllCounselingRecords() {
        return counselingRecordService.getAllCounselingRecordsWithStudentName();
    }


}

